package io.sdl.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.sdl.dao.RoleUserDao;
import io.sdl.entity.RoleUserEntity;
import io.sdl.service.RoleUserService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import io.sdl.common.service.impl.BaseServiceImpl;

import java.util.List;


@Service
@AllArgsConstructor
public class RoleUserServiceImpl extends BaseServiceImpl<RoleUserDao, RoleUserEntity> implements RoleUserService {


    @Override
    public List<RoleUserEntity> getRoleUsersByRoleId(Long userId) {
        return  baseDao.selectByUserId(userId);
    }


    @Override
    public RoleUserEntity getRoleUserByRoleIdAndUserId(Long roleId, Long userId) {
        return baseDao.getRoleUserByRoleIdAndUserId(roleId,userId);
    }

    @Override
    public Integer unbindRole(Long userId, long roleId) {

        return baseDao.unbindRole(userId,roleId);
    }
}